<?php

declare(strict_types=1);

namespace app\model;

use think\Model;
use think\model\concern\SoftDelete;

class UserAuth extends Model
{
    use SoftDelete;

    protected $name = 'user_auth';

    protected $autoWriteTimestamp = 'datetime';

    protected $json = ['metadata'];

    public const TYPE_PASSWORD = 'password';
    public const TYPE_SMS = 'sms';
    public const TYPE_WECHAT = 'wechat';
    public const TYPE_DINGTALK = 'dingtalk';

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }
}
